<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.jaxplat.commons.Row"%>
<%@page import="com.jaxplat.commons.RowImpl"%>
<%@page import="com.rs.commons.RsConstant"%>
<%@page import="java.util.List"%>
<%
    String contextPath = request.getContextPath();
			Row dsInfo = new RowImpl();
			if (null != request.getAttribute("dsInfo")) {
				dsInfo = (Row) request.getAttribute("dsInfo");
			}
			java.util.List validateResult = null;
			if (null != request.getAttribute("validateResult")) {
				validateResult = (java.util.List) request
						.getAttribute("validateResult");
			}
			String idNo = (null == request.getAttribute("id_no"))
					? ""
					: (String) request.getAttribute("id_no");
			// String idType= (null == request.getAttribute("id_type")) ? "" : (String)request.getAttribute("id_type");
			String applicantName = (null == request
					.getAttribute("applicant_name")) ? "" : (String) request
					.getAttribute("applicant_name");
			String gender = (null == request.getAttribute("gender"))
					? ""
					: (String) request.getAttribute("gender");
			String mobileNo = (null == request.getAttribute("mobile_no"))
					? ""
					: (String) request.getAttribute("mobile_no");
			String birthYear = (null == request.getAttribute("birth_year"))
					? ""
					: (String) request.getAttribute("birth_year");
			String birthMonth = (null == request.getAttribute("birth_month"))
					? ""
					: (String) request.getAttribute("birth_month");

			List userContacts = null;
			if (null != request.getAttribute("userContacts")) {
				userContacts = (List) request.getAttribute("userContacts");
			}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="预约挂号,预约诊疗,门诊预约,网上医院,网上挂号" name="Keywords">
<meta
	content="预约挂号平台提供各大三甲医院知名专家的网上预约就医服务。同时提供就医咨询、导医陪诊、专家会诊、住院转院、安排手术等服务"
	name="description">
<title>预约挂号、预约诊疗-云南移动无线城市</title>
<link rel="stylesheet" type="text/css"
	href="<%=contextPath%>/css2/style.css" />
<script src="<%=contextPath%>/js/jquery-1.7.2.min.js"
	type="text/javascript"></script>
<script src="<%=contextPath%>/js/common.js" type="text/javascript"></script>

<script type="text/javascript">
		function submitForm() 
		{
			var msgList = validateForm();
			if(msgList.length > 0)
			{
				var msgStr = '';
				for(var i=0; i < msgList.length;i++)
				{
						msgStr += msgList[i] + '<br />';
				}
				$('#divMsg').empty();
				$('#divMsg').append(msgStr);
				return;
			}
			else
			{
				$("#form1").submit();
			}
		}
		function validateForm()
		{
			var msg = new Array();
			if($('input[name="contact_id"]:checked').val()=='0')
			{
				if($("#applicant_name_1").val()=='')
				{
					msg.push('患者姓名不能为空.');
				}
				if($("#id_no_1").val()=='')
				{
					msg.push('身份证号不能为空.');
				}
				//alert($('input[name="gender"]:checked').val());
				if($('input[name="gender"]:checked').val()=='')
				{
					msg.push('请选择性别.');
				}
				if($('#applicant_addr_1').val()=='')
				{
					msg.push('地址不能为空.');
				}
			}
			else if($('input[name="contact_id"]').size() > 0 && $('input[name="contact_id"]:checked').val()!='0')
			{
				if($('input[name="contact_id"]:checked').val()=='')
				{
					msg.push('请填写患者基本信息.');
				}
			}
			return msg;
			
		}
		
		function replayInfo(contact_id){  
	     var radio=document.getElementById("patient_info_0");
		 radio.style.display="none";
		 $(document).ready(function(){  
		        $.ajax({  
		                           url :'<%=request.getContextPath()%>/web2/reserve.do?method=replayInfo&contact_id='+contact_id,  //后台处理程序  
		                           type:"post",    //数据发送方式  
		                          async:false,  
		                           dataType:"json",   //接受数据格式             
		                          error: function(){  
		                           alert("服务器没有返回数据，可能服务器忙，请重试");  
		                          },  
		                           success: function(json){  
		                             var patientInfo = eval(json); 
		                             //填充数据
		                            document.getElementById("applicant_name_1").value =  patientInfo.name;
		                            document.getElementById("id_no_1").value = patientInfo.idCardNo;
		                            document.getElementById("applicant_addr_1").value  = patientInfo.address;
		                            }   
		           });                     
		    });  
		
		 
		 var radio1=document.getElementById("patient_info_1");
		 
		 radio1.style.visibility="visible";
		
		 } 
		 
		 function showPatientInfo0(){
		  var radio=document.getElementById("patient_info_1");
		 		radio.style.display="none";
		 var radio1=document.getElementById("patient_info_0");
		 		radio1.style.visibility="visible";
		 }
 
		</script>

<!--[if IE 6]>
 <style type="text/css">
 .w942m {
	width:942px;
	margin:0 auto;
	margin-top:150px;
}
.main_left .main_box_title {
	background: url("../images/h4bg.png") no-repeat scroll left top transparent;
	height:43px;
	margin-left:-10px;
	position:absolute;
	top:10px;
}
 </style>
<![endif]-->

<!--[if IE 7]>
 <style type="text/css">
 .w942m {
	width:942px;
	margin:0 auto;
	margin-top:150px;
}
.main_left .main_box_title {
	background: url("../images/h4bg.png") no-repeat scroll left top transparent;
	height:43px;
	margin-left:-10px;
	position:absolute;
	top:10px;
}
 </style>
<![endif]-->

</head>
<body>
	<%=request.getSession().getAttribute("headerContentWeb")%>
	<div class="guahao">
		<!--start header-->
		<%@ include file="head.jsp"%>
		<!--end header-->
		<div class="clear mb8"></div>
		<!--start main-->
		<form id="form1" name="form1" method="post"
			action="<%=request.getContextPath()%>/web2/reserve.do?method=confirm&portaltype=0&version=&areacode=<%=session.getAttribute("areacode")%>">
			<div class="main w942m">
				<div class="main_left2 fl w150">
					<div class="main_box">
						<div class="main_box_title">
							<div class="titleleft fl"></div>
							<div class="right_titlemain fl">
								<h4 class="h4">预约管理</h4>
							</div>
							<div class="titleright fl"></div>
						</div>
						<div class="right_main_box_cont">
							<!--navlist开始-->
							<ul class="navlist">
								<li><a
									href="<%=contextPath%>/web2/reserveManageAction.do?method=reserverOrderList&flag=1&browseFalg=web">未支付预约</a>
								</li>
								<li><a
									href="<%=contextPath%>/web2/reserveManageAction.do?method=reserverOrderList&flag=2&browseFalg=web">我的预约</a>
								</li>
								<li><a
									href="<%=contextPath%>/web2/reserveManageAction.do?method=reserverOrderList&flag=3&browseFalg=web">历史预约</a>
								</li>
								<li><a
									href="<%=contextPath%>/web2/reserveManageAction.do?method=reserverOrderList&flag=4&browseFalg=web">常用联系人</a>
								</li>
							</ul>
							<!--navlist结束-->
						</div>
						<!--end left_main_box_cont-->
						<div class="right_box_bottom mb8"></div>
					</div>
					<!--end main_box-->
				</div>
				<!--end main_left-->
				<div class="main_right2 fl w780">
					<div class="main_box_list">
						<div class="once_top"></div>
						<div class="right_main_box_cont">
							<div class="box_keylist">
								<div class="step">
									<span>选择</span><span>→</span><span class="on">填写信息</span><span>→</span><span>支付</span><span>→</span><span>完成预约</span>
								</div>
								<div class="bc">
									<div class="apps_titleName">
										<span class="apps_titleLeft">预约基本信息</span>
									</div>
									<table border="0" cellspacing="0" cellpadding="0"
										style="table-layout: fixed;" width="100%" class="infro2_table">
										<tr>
											<td width="90px" class="textR">专家名称：</td>
											<td width="160px"><%=dsInfo.getString("doctor_name")%> <input
												id="ds_id" name="ds_id" type="hidden"
												value="<%=dsInfo.getLong("ds_id")%>" /> <input
												id="doctor_id" name="doctor_id" type="hidden"
												value="<%=dsInfo.getLong("doctor_id")%>" /></td>
											<td width="90px" class="textR">专家职称：</td>
											<td width="160px"><%=dsInfo.getString("pro_title_name")%>
												- <%=dsInfo.getString("pro_title")%> <input id="pro_title"
												name="pro_title" type="hidden"
												value="<%=dsInfo.getString("pro_title")%>" /></td>
											<td width="90px" class="textR">预约时间：</td>
											<td><%=com.jaxplat.util.DateUtils.parseDate(dsInfo.getDate("sc_date"))%>
												&nbsp;<%=dsInfo.getString("batch_name")%></td>
										</tr>
										<tr>
											<td class="textR">所属科室：</td>
											<td><%=dsInfo.getString("sec_name")%> <input
												id="section_id" name="section_id" type="hidden"
												value="<%=dsInfo.getString("sec_name")%>" /></td>
											<td class="textR">医院名称：</td>
											<p>
												<td colspan="3"><%=dsInfo.getString("hos_name")%>
											</p>
											</td>
										</tr>

									</table>
									<div class="apps_titleName">
										<span class="apps_titleLeft">支付信息</span>
									</div>
									<table border="0" cellspacing="0" cellpadding="0" width="100%"
										class="infro2_table">
										<tr>
											<td width="90px" class="textR">支付方式：</td>
											<td width="100px"><input id="pay_type"
														name="pay_type" type="radio" checked="checked"
														value="1" >手机支付</input></td>
											<td width="90px" class="textR">支付手机号：</td>
											<td width="100px"><%-- <%=request.getSession().getAttribute("mobile").toString()%>
												<input type="hidden" name="mobile_no" maxlength="11"
												value="<%=request.getSession().getAttribute("mobile").toString()%>" /> --%>
												<input id="mobile_no" name="mobile_no"
														type="text" value="" style="width: 100px;" maxlength="20" value="<%=request.getSession().getAttribute("mobile") %>"></input>
												
											</td>
											<td width="90px" class="textR">挂号费：</td>
											<td class="red"><%=com.rs.util.Utils.formatMoney(RsConstant.DOCTOR_FEE.getDouble(dsInfo.getString("pro_title")), "0.00")%>
												元</td>

											<td width="90px" class="textR">信息费：</td>
											<td class="red"><%=com.rs.util.Utils.formatMoney(RsConstant.RS_INFO_SERVICE_FEE, "0.00")%>元
											</td>
										</tr>
									</table>
									<div id='patient_info_0' class="list_table">
										<div class="apps_titleName">
											<span class="apps_titleLeft">患者基本信息</span>
										</div>
										<table border="0" cellspacing="0" cellpadding="0" width="100%"
											class="infro_table">
											<thead>
												<tr>
													<th width="5%" class="apps_firstth1">&nbsp;</th>
													<th width="10%">患者姓名</th>
													<th width="15%">身份证号</th>
													<th width="15%">性别</th>
													<th width="55%">住址</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td class="apps_firstth1"><input id="contact_id_0"
														name="contact_id_0" type="radio" checked="checked"
														value="0" />
													</td>
													<td><input id="applicant_name" name="applicant_name"
														type="text" value="" style="width: 70px;" maxlength="20" />
													</td>
													<td><input name="id_no" type="text" value=""
														maxlength="20" /></td>
													<td><input id="gender_m" name="gender" name="gender"
														value="m" checked="checked" type="radio" /> 男 <input
														id="gender_f" name="gender" type="radio" value="f" /> 女</td>
													<td class="apps_firstth2"><input id="applicant_addr"
														name="applicant_addr" type="text" value=""
														style="width: 200px;" maxlength="15" /></td>
												</tr>
												<%
												    if (null != userContacts && userContacts.size() > 0)
												    {
												        for (int i = 0; i < userContacts.size(); i++)
												        {
												            Row row = (Row) userContacts.get(i);
												%>
												<tr>
													<td class="apps_firstth1"><input id="contact_id_0"
														name="contact_id_0" type="radio"
														value="<%=row.getString("id")%>"
														onclick="replayInfo(<%=row.getString("id")%>);" /><%=row.getString("id")%>
													</td>
													<td><%=row.getString("name")%></td>
													<td><%=row.getString("id_card_no")%></td>
													<td>
														<%
														    if ("m".equals(row.getString("sex")))
														            {
														                out.print("男");
														            }
														            else
														            {
														                out.print("女");
														            }
														%>
													</td>
													<td class="apps_firstth2"><%=row.getString("address")%>
													</td>
												</tr>
												<%
												    }
												    }
												%>
											</tbody>
										</table>
										<div class="btn_div">
											<a href="javascript:void(0)" onclick="submitForm();"
												class="btn_blue">确认提交</a>&nbsp;&nbsp; <a
												href="javascript:void(0)" onclick="history.go(-1)"
												class="btn_blue">返回</a>
										</div>

										<div class="clear"></div>
									</div>
									<div id="patient_info_1" style="visibility:collapse;"
										class="list_table">
										<div class="apps_titleName">
											<span class="apps_titleLeft">患者基本信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;历史预约人</span> 
										</div>
										<table border="0" cellspacing="0" cellpadding="0" width="100%"
											class="infro_table">
											<thead>
												<tr>
													<th width="5%" class="apps_firstth1">&nbsp;</th>
													<th width="10%">患者姓名</th>
													<th width="15%">身份证号</th>
													<th width="15%">性别</th>
													<th width="55%">住址</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td class="apps_firstth1"><input id="contact_id_1"
														name="contact_id_1" type="radio" checked="checked"
														value="0" />
													</td>
													<td><input id="applicant_name_1"
														name="applicant_name_1" type="text" value=""
														style="width: 70px;" maxlength="20" />
													</td>
													<td><input id="id_no_1" name="id_no_1" type="text"
														value="" maxlength="20" /></td>
													<td><input id="gender_m" name="gender_1" value="m"
														checked="checked" type="radio" /> 男 <input id="gender_f"
														name="gender_1" type="radio" value="f" /> 女</td>
													<td class="apps_firstth2"><input id="applicant_addr_1"
														name="applicant_addr_1" type="text" value=""
														style="width: 200px;" maxlength="15" /></td>
												</tr>
											</tbody>
										</table>
										<div class="btn_div">
											<a href="javascript:void(0)" onclick="submitForm();"
												class="btn_blue">确认提交</a>&nbsp;&nbsp; <a
												href="javascript:void(0)" onclick="history.go(-1)"
												class="btn_blue">返回</a>
										</div>
										<div id="divMsg" class="btn_div"
											style="text-align:left;color:red;"></div>
									</div>
									<!--end bc-->
								</div>
								<!--end inbox-->
							</div>
							<!--end right_main_box_cont-->
							<div class="left_box_bottom mb8"></div>
						</div>
						<!--end main_box-->
					</div>
					<!--end main_right-->
				</div>
		</form>
		<!--end main_left-->
	</div>
	<!--end main-->
	<div class="clear"></div>

	<form id="form2" action="" method="post" name="form2"></form>

</body>
</html>